libxl: fix memory management in "xl network-attach"
authorDavid Scott <dave.scott@eu.citrix.com>
Thu, 31 Mar 2011 18:19:16 +0000 (19:19 +0100)
committerDavid Scott <dave.scott@eu.citrix.com>
Thu, 31 Mar 2011 18:19:16 +0000 (19:19 +0100)
commit0021f2b8d6bad056f3b9d0c3afef25fbf5a23f2d
tree61f0b58ee7719a3a9e1fe7fc1d7f6634547daf36
parentbce637c6e406b9b396bbbe9be080e724cd428a2e
libxl: fix memory management in "xl network-attach"

The libxl_device_nic struct has strings which are initially strdup()ed
and then free()ed in libxl_device_nic_destroy(). In the
"network-attach" parser we need to free() the existing string and
strdup((*argv) + N), rather than just copying the pointer.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/xl_cmdimpl.c